package com.biz.datascope;

import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/**
 * @author LXY
 * @Description
 * @create 2025/06/28
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class DataScope extends HashMap {

    /**
     * 限制的字段名称
     */
    private String scopeName;

    /**
     * 具体的条件
     */
    private String scopeContext;

    /**
     * 函数名称，默认 SELECT * ;
     *
     * <ul>
     * <li>COUNT(1)</li>
     * </ul>
     */
    private DataScopeFuncEnum func = DataScopeFuncEnum.ALL;

    /**
     * of 获取实例
     */
    public static DataScope of() {
        return new DataScope();
    }

    public DataScope scopeName(String scopeName) {
        this.scopeName = scopeName;
        return this;
    }

    public DataScope scopeContext(String scopeContext) {
        this.scopeContext = scopeContext;
        return this;
    }

    public DataScope func(DataScopeFuncEnum func) {
        this.func = func;
        return this;
    }
}
